package com.weiai.wedding.web.user;

import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.weiai.wedding.entity.user.MenuTree;
import com.weiai.wedding.service.user.AuthService;
import com.weiai.wedding.service.user.UserService;

/**
 * 权限树信息控制器
 * 
 * @author wangweiheng
 * 
 */
@Controller
@RequestMapping(value = "/user/tree")
public class TreeController {
	@Autowired
	private AuthService authService;
	/**
	 * 
	 * @param id 用户id
	 * @return
	 */
	@RequestMapping(value = "createUserTree")
	@ResponseBody
	public List<MenuTree> createZtree() {
		List<MenuTree> list = authService.getAllAuth(null);
		return list;
	}
	
	@RequestMapping(value = "updateUserTree/{id}")
	@ResponseBody
	public List<MenuTree> updateZtree(@PathVariable("id") String id) {
		List<MenuTree> list = authService.getAllAuth(id);
		return list;
	}
	
	@RequestMapping(value = "viewUserTree/{id}")
	@ResponseBody
	public List<MenuTree> getViewUserZtree(@PathVariable("id") String id) {
		List<MenuTree> list = authService.getAllViewUserAuth(id);
		return list;
	}
}
